******************************************
*** Shoring Up Autocracy: Main & Appdx *** 
**** Data analyzed using version 15.1 ****
******************************************



***Part 1: Approval of Putin

**Load Data
clear all
set more off, perm
global data1 "C:\Users\chapmah\Documents\Part1_FinalData"     //* Alter accordingly


*Figure 1
ttest putinapprove, by(directline)
cibar putinapprove, over(directline) 
ttest putinapprove, by(issueres)
cibar putinapprove, over(issueres)

**Appendix

*ANOVA (Table A3)
anova putinapprove directline##issueres

*OLS and Ordinal Probit Regressions (Table A4)
reg putinapprove directline, robust
reg putinapprove issueres, robust
reg putinapprove directline issueres, robust
reg putinapprove i.directline##i.issueres, robust
reg putinapprove directline issueres i.educ, robust
reg putinapprove directline issueres i.educ male ib2.income age urban, robust

oprobit putinapprove directline
oprobit putinapprove issueres
oprobit putinapprove directline issueres
oprobit putinapprove i.directline##i.issueres
oprobit putinapprove directline issueres i.educ
oprobit putinapprove directline issueres i.educ male ib2.income age urban

*Difference in Means 2x2 (Table A5)
ttest putinapprove if issueres==0, by(directline)
ttest putinapprove if issueres==1, by(directline)
ttest putinapprove if directline==0, by(issueres)
ttest putinapprove if directline==1, by(issueres)

*Heterogeneous Treatment Effect (Figure A10)
reg putinapprove i.directline##i.presvote issueres i.educ male i.income age urban, robust
margins presvote, dydx(directline) 


***Part 2: Perceptions of Voice

**Load Data
clear all
set more off, perm
global data2 "C:\Users\chapmah\Documents\Part2_FinalData"     //* Alter accordingly


*Figure 2
ttest voice, by(directline)
cibar voice, over(directline)

*Generate political sophistication variable
gen polisoph=.
replace polisoph=0 if vote==0 & intpol==0
replace polisoph=1 if (vote==0 & intpol==1) | (vote==1 & intpol==0)
replace polisoph=2 if vote==1 & intpol==1

*Figure 3
probit voice2  polisoph##i.directline i.trustpres##i.directline i.educ male age i.income urban
margins polisoph trustpres, dydx(directline) level(90) saving(“ci90”, replace)
margins polisoph trustpres, dydx(directline) level(95) saving(“ci95”, replace)
combomarginsplot “ci90” “ci95”, horizontal xline(0) yscale(reverse) recast(scatter) xdimension(polisoph trustpres)



**Appendix

*T-test (Table A7)
ttest voice2, by(directline)

*OLS, Ordinal Probit, and Probit Regressions (Table A8)
reg voice directline, robust
reg voice directline male i.educ male age ib2.income urban, robust

oprobit voice directline
oprobit voice directline male i.educ male age ib2.income urban

probit voice2 directline
probit voice2 directline male i.educ male age ib2.income urban


*HTE Interest in Politics, Vote, and Trust in Putin: OLS (Figure 7)
reg voice i.intpol##i.directline i.vote##i.directline i.trustpres##i.directline i.educ male age i.income urban, robust
margins intpol vote trustpres, dydx(directline) 

*HTE Political Sophistication: OLS (Figure 8)
reg voice  polisoph##i.directline i.trustpres##i.directline i.educ male age i.income urban, robust
margins polisoph trustpres, dydx(directline) 

*HTE Political Sophistication: Ordinal Probit (Figure 9)
oprobit voice  polisoph##i.directline i.trustpres##i.directline i.educ male age i.income urban
margins polisoph trustpres, dydx(directline)
